extends Eqp


var utils = null
var once = false
func _init():
	pass

func setLv(val):
	if val <= 5:
		lvPerVal = 0.3
	else:
		lvPerVal = 0.5
	.setLv(val)
	
func createRndLv(lv,minLv = 1,maxLv = 999):
	minLv = max(2, minLv)
	var rlv = 1
	for i in lv :
		var v = rnp.lvPool.rndItem()
		if v > rlv : rlv = v
	rlv = clamp(rlv,minLv,maxLv)
	return create(clamp(rlv,1,self.maxLv)) 

func create(lv):
	gems.clear()
	self.lv = lv
	if lv < 2:lv = 2
	for i in lv:
		if i == 0 or i > 4:continue
		if i < 3 :
			plusGem(i+1)
		else:
			plusGemUnique(i+1)
	return self
